from apps.common.base.serializers import *
from apps.account.models import *
from rest_framework.authtoken.models import Token

class TokenBaseSerializer(serializers.ModelSerializer):

    class Meta:
        model = Token
        fields = '__all__'

class TokenModelSerializer(TokenBaseSerializer):

    class Meta:
        model = Token
        fields = '__all__'


class AccountBaseSerializer(BaseSerializer):
    username = serializers.CharField(required=False, allow_blank=True, allow_null=True)
    password = serializers.CharField(required=False, allow_blank=True, allow_null=True)
    class Meta:
        model = Account
        fields = "__all__"


class AccountModelSerializer(BaseSerializer):

    class Meta:
        model = Account
        exclude = ['password']
